Skip to main content
POST
Create an API key. Its `secret` is shown once, here.

Authorizations

Authorization
string
header
required

A person's session: Authorization: Bearer <ID token>, the ID token the Sendblue sign-in issues. The person acts in their company's root account with the role of their seat.

Headers

Idempotency-Key
string
required

A value unique to this intended write, 1 to 128 visible ASCII characters. A repeat with the same key returns the original result.

Required string length: 1 - 128
Pattern: ^[\x21-\x7E]+$

Body

application/json

Optional. An absent body is an empty object.

Omitting both role and permissions requests a Standard key. With a role and an explicit list, every listed permission must belong to the role. Only the explicit permissions are granted. A key with explicit grants uses the native API only, except when both the standard role and its exact unchanged permission set were requested. accounts:create, subaccounts:manage, team:manage, team:read and webhooks:receive cannot be delegated to a key.

name
string
Maximum string length: 64
role
enum<string>

standard preserves the historical Standard key grants. read_only grants the read operations in the Standard bundle. messaging grants me:read, messages:read and messages:send. billing_read grants me:read and billing:read (balance).

Available options:
standard,
read_only,
messaging,
billing_read
permissions
enum<string>[]
Available options:
accounts:create,
billing:history,
billing:read,
billing:refill,
billing:top_up,
brands:read,
brands:write,
calls:create,
calls:read,
calls:write,
campaigns:read,
campaigns:write,
company_settings:read,
contacts:read,
contacts:write,
keys:manage,
me:read,
media:read,
media:write,
messages:read,
messages:send,
messages:write,
number_orders:cancel,
number_orders:create,
number_orders:read,
numbers:purchase,
numbers:read,
numbers:release,
numbers:write,
operations:read,
prices:read,
recordings:read,
recordings:write,
settings:read,
settings:write,
subaccounts:manage,
tags:read,
tags:write,
team:manage,
team:read,
variables:read,
variables:write,
webhooks:manage,
webhooks:receive,
workflows:read,
workflows:write
expires_at
string<date-time>

Future RFC 3339 timestamp bounded by the issuing key's expiry.

Response

Matching issuance replay. The original key metadata excludes its secret.

id
string
required
name
string
required
permissions
enum<string>[]
required

Effective permission names in lexical order. Grants are immutable after issuance.

Available options:
accounts:create,
billing:history,
billing:read,
billing:refill,
billing:top_up,
brands:read,
brands:write,
calls:create,
calls:read,
calls:write,
campaigns:read,
campaigns:write,
company_settings:read,
contacts:read,
contacts:write,
keys:manage,
me:read,
media:read,
media:write,
messages:read,
messages:send,
messages:write,
number_orders:cancel,
number_orders:create,
number_orders:read,
numbers:purchase,
numbers:read,
numbers:release,
numbers:write,
operations:read,
prices:read,
recordings:read,
recordings:write,
settings:read,
settings:write,
subaccounts:manage,
tags:read,
tags:write,
team:manage,
team:read,
variables:read,
variables:write,
webhooks:manage,
webhooks:receive,
workflows:read,
workflows:write
role
enum<string> | null
required

The named preset when issued without narrowing, or null for a custom scope.

Available options:
standard,
read_only,
messaging,
billing_read
created_by
string | null
required

Creator's credential or user identifier, null when never recorded.

expires_at
string<date-time> | null
required
last_used_at
string<date-time> | null
required
created_at
string<date-time>
required

RFC 3339, UTC.

updated_at
string<date-time>
required

RFC 3339, UTC.